<?php

/*  lamp-shade_0.1
 *  License: GNU GPL v3
 *  File: ./modules/standard/exceptions.php
 *  Last Mod.:  04/11/11 by Werner
 *  Authors:    Werner Roets
 *              Frank Adrian
 *  Description:
 *  This class holds custom lamp-shade exceptions
 */

//Throw this exception when the wrong argument is passed
class ArgumentTypeException extends Exception
{
    private $Class_name;
    private $Expects;
    public function __construct($bad_data, $expects)
    {
        $this->expects = $expects;
        $reflection = new ReflectionClass($bad_data);
        $class_name = $reflection->getName();
    }
    public function Message()
    {      
        return 'lampshade error on line ' . $this->line . ' in file ' . $this->file . ' expecting '. $this->Expects .' object type and you used: ' . $this->Class_name;
    }
}

class ContentEmptyException extends Exception
{
    //private $Page_name;
    public function Message()
    {
        return 'lampshade error on line ' . $this->line . ' in file ' . $this->file . '. The content of the page is empty.';
    }
}

class NoSuchPageException extends Exception
{
    private $Page_name;
    
    public function __construct($page_name)
    {
        $this->Page_name = $page_name;    
    }
    public function Message()
    {
        return 'lampshade error on line ' . $this->line . ' in file ' . $this->file . '. The page ' . $this->Page_name . ' is not known by lampshade';
    }
}
?>